use git_tools::app;
use sea_orm::{EntityTrait, Set};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    app::bootstrap::init().await?;
    let db = common::get_conn();
    let rows = (1..151).map(|i| dao::gitlab_info::ActiveModel {
        user_id: Set(Some(i.to_string())),
        user_name: Set(Some(format!("姓名 {i}"))),
        ..Default::default()
    });
    let result = dao::gitlab_info::Entity::insert_many(rows)
        .on_empty_do_nothing()
        .exec(&db)
        .await?;
    // let result = entity::gitlab_info::Entity::find_by_id(1).one(&db).await?;
    tracing::info!("批量保存完成: {:#?}", result);
    Ok(())
}
